<html>
    <head>
    <title>TITLE TODO</title>
    <script type="text/javascript" src="/static/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="/static/js/ViewContext.js"></script>
    <script type="text/javascript" src="/static/js/planet.js"></script>
    <script type="text/javascript" src="/static/js/star.js"></script>
    <script type="text/javascript" src="/static/js/solar_system.js"></script>
    <script type="text/javascript" src="/static/js/three.min.js"></script>
    <script type="text/javascript" src="/static/js/OrbitControls.js"></script>
    <style>
        body {margin: 0; padding: 0;}
        canvas {background-image: url('/static/img/bg.jpg');}
    </style>
    </head>
    <body>
<!--         <div style="position:absolute; margin:auto;" >
          <a href="javascript:displayPlanet(view_context);">
            PLANET
          </a> | 
          <a href="javascript:displaySolarSystem(view_context);">
            SOLAR SYSTEM
          </a>
        </div> -->
        
        <script type="text/javascript">

        jQuery(function(){

        	// The view context, brain of all things
        	var view_context = new viewContext();

        	// The render mehod, heart of all things
        	var render = function() {
                requestAnimationFrame(render);
                view_context.animateFunctions.forEach(
                        function(atomic_animate, index, functions){
                            atomic_animate();})
                /* view_context.controls.update(); */
                view_context.renderer.render(view_context.scene, view_context.camera);
            };

            var onWindowResize = function(){
                view_context.onWindowResize();
            };
            
            // Life goes on
            document.body.appendChild(view_context.renderer.domElement);
            window.addEventListener( 'resize', onWindowResize, false );
            displaySolarSystem(view_context);
            render();

        });

        </script>
        
    </body>
</html>